<div class="content-box">
    <div class="content-box-header">
        <h3 style="cursor: s-resize; ">系统配置</h3>
        <ul class="content-box-tabs">
            <li><a class="default-tab current" href="#tab1">附件设置</a></li>
            <li><a class="" href="#tab2">图片水印</a></li>
            <li><a class="" href="#tab3">其他设置</a></li>
        </ul>
        <div class="clear"></div>
    </div>
    <div class="content-box-content">
        <!-- 附件设置 start -->
        <div class="tab-content default-tab" id="tab1" >
        	<if condition="isset($notice) && $name eq 'attach'">
            	<include file="Public:notice" status="{$notice.status}" message="{$notice.message}" />
            </if>
            <form action="" method="post">
                <p>
                    <label>允许图片上传的类型：</label>
                    <span class="tips align-right">* 请用 | 隔开</span>
                    <input type="text" class="text-input medium-input" name="attach[imageType]" value="{$sysConfig.attach.imageType}"> 
                </p>
                <p>
                    <label>允许文件上传的类型：</label>
                    <span class="tips align-right">* 请用 | 隔开</span>
                    <input type="text" class="text-input medium-input" name="attach[fileType]" value="{$sysConfig.attach.fileType}" > 
                </p>
                <p>
                    <label>上传图片缩略图宽度：</label>
                    <span class="tips align-right">* 上传图片时生成的缩略图默认宽度</span>
                    <input type="text" class="text-input small-input" name="attach[thumbWidth]"  value="{$sysConfig.attach.thumbWidth}"> px
                </p>
                <p>
                    <label>上传图片缩略图高度：</label>
                    <span class="tips align-right">* 上传图片时生成的缩略图默认高度</span>
                    <input type="text" class="text-input small-input" name="attach[thumbHeight]"  value="{$sysConfig.attach.thumbHeight}"> px
                </p>
                <p>
                    <label>允许上传的最大值：</label>
                    <span class="tips align-right">* 上传的图片或者文件的最大值 （1m = 1024bytes）</span>
                    <input type="text" class="text-input small-input" name="attach[uploadMaxSize]"  value="{$sysConfig.attach.uploadMaxSize}"> bytes
                </p>
                <p>
                    <input class="button" type="submit" value="保存">
                </p>
            </form>
        </div>
        <!-- 附件设置 end -->

        <!-- 图片水印 start -->
        <div class="tab-content" id="tab2">
        	<if condition="isset($notice) && $name eq 'water'">
            	<include file="Public:notice" status="{$notice.status}" message="{$notice.message}" />
            </if>
            <form action="" method="post" enctype="multipart/form-data">
                <p>
                    <label>开启水印：</label>
                    <span class="tips align-right">* 如果开启水印，则上传的图片会默认加上水印</span>
                    <input type="radio" name="water[waterStatus]" id="waterOpen" value="1" <if condition="$sysConfig['water']['waterStatus'] eq 1">checked</if>><label for="waterOpen" style="display: inline-block">开启</label>
                    <input type="radio" name="water[waterStatus]" id="waterClose" value="0" <if condition="$sysConfig['water']['waterStatus'] neq 1">checked</if>><label for="waterClose" style="display: inline-block">关闭</label>
                </p>
                <p>
                    <label>水印类型：</label>
                    <span class="tips align-right">* 请选择水印的类型</span>
                    <input type="radio" name="water[waterType]" id="waterWords" value="words" onclick="$('.waterWords').show();$('.waterImages').hide();" <if condition="$sysConfig['water']['waterType'] eq 'words'">checked</if>><label for="waterWords" style="display: inline-block">文字</label>
                    <input type="radio" name="water[waterType]" id="waterImages" value="images" onclick="$('.waterImages').show();$('.waterWords').hide();" <if condition="$sysConfig['water']['waterType'] eq 'images'">checked</if>><label for="waterImages" style="display: inline-block">图片</label>
                </p>
                <p class="waterWords">
                    <label>水印文字：</label>
                    <span class="tips align-right">* 请输入你要显示的文字</span>
                    <input type="text" class="text-input medium-input" name="water[waterWords]" value="{$sysConfig.water.waterWords}"> 
                </p>
                <p class="waterWords">
                    <label>文字颜色：</label>
                    <span class="tips align-right">* 请选择水印文字的颜色</span>
                    <input type="text" class="text-input medium-input" name="water[waterWordsColor]" id="waterWordsColor" value="{$sysConfig.water.waterWordsColor}">
                </p>
                <p class="waterImages">
                    <label>水印图片：</label>
                    <a href="/Uploads/waterMark/{$sysConfig.water.waterUploadImages}" target="_blank"><img src="/Uploads/waterMark/{$sysConfig.water.waterUploadImages}" width="90" height="90"></a>    
                </p>
                <p class="waterImages">
                    <label>上传水印图片：</label>
                    <input type="file" name="water[waterUploadImages]">
                </p>
                <p>
                    <label>水印位置：</label>
                    <input type="radio" name="water[waterPosition]" value="topLeft" <if condition="$sysConfig['water']['waterPosition'] eq 'topLeft'">checked</if>>顶部居左 <input type="radio" name="water[waterPosition]" value="topCenter" <if condition="$sysConfig['water']['waterPosition'] eq 'topCenter'">checked</if>>顶部居中 <input type="radio" name="water[waterPosition]" value="topRight" <if condition="$sysConfig['water']['waterPosition'] eq 'topRight'">checked</if>>顶部居右 <br>
                    <input type="radio" name="water[waterPosition]" value="centerLeft" <if condition="$sysConfig['water']['waterPosition'] eq 'centerLeft'">checked</if>>中部居左 <input type="radio" name="water[waterPosition]" value="centerCenter" <if condition="$sysConfig['water']['waterPosition'] eq 'centerCenter'">checked</if>>中部居中 <input type="radio" name="water[waterPosition]" value="centerRight" <if condition="$sysConfig['water']['waterPosition'] eq 'centerRight'">checked</if>>中部居右 <br>
                    <input type="radio" name="water[waterPosition]" value="bottomLeft" <if condition="$sysConfig['water']['waterPosition'] eq 'bottomLeft'">checked</if>>底部居左 <input type="radio" name="water[waterPosition]" value="bottomCenter" <if condition="$sysConfig['water']['waterPosition'] eq 'bottomCenter'">checked</if>>底部居中 <input type="radio" name="water[waterPosition]" value="bottomRight" <if condition="$sysConfig['water']['waterPosition'] eq 'bottomRight'">checked</if>>底部居右 <br>
                </p>
                <p>
                    <input class="button" type="submit" value="保存">
                </p>
            </form>
        </div>
        <!-- 图片水印 end -->

        <!-- 其他设置 start -->
        <div class="tab-content" id="tab3">
        	<if condition="isset($notice) && $name eq 'other'">
            	<include file="Public:notice" status="{$notice.status}" message="{$notice.message}" />
            </if>
        	<form action="" method="post">
                <p>
                        <label>文章过滤词语：</label>
                        <span class="tips align-right">* 词语会被替换成*** ，词语用 | 隔开。</span>
                        <input type="text" class="text-input medium-input" name="other[filterWords]" value="{$sysConfig.other.filterWords}">
                </p>
                <p>
                        <label>列表页面显示条数：</label>
                        <span class="tips align-right">* 设置网站列表页面显示的默认条数</span>
                        <input type="text" class="text-input small-input" name="other[listRows]" value="{$sysConfig.other.listRows}">
                </p>
                <p>
                        <label>内容标题显示最大长度：</label>
                        <span class="tips align-right">* 设置标题的长度（10-240之间）</span>
                        <input type="text" class="text-input small-input" name="other[titleLength]" value="{$sysConfig.other.titleLength}">
                </p>
                <p>
                        <label>文章默认点击数：</label>
                        <span class="tips align-right">* 设置文章的被点击数（0为随机显示）</span>
                        <input type="text" class="text-input small-input" name="other[articleHits]" value="{$sysConfig.other.articleHits}">
                </p>
                <p>
                    <input class="button" type="submit" value="保存">
                </p>
            </form>
        </div>
        <!-- 其他设置 end -->
    </div>
</div>

<script>
	$(function(){
		//水印类型显示
		water_type = "{$sysConfig.water.waterType}";
		if(water_type == "words"){
			$(".waterWords").show();
			$(".waterImages").hide();
		}else{
			$(".waterImages").show();
			$(".waterWords").hide();
		}

		tab = "{$name}";
		switch (tab){
			case "attach":
				$(".content-box-tabs li:eq(0) a").click();
				break;
			case "water":
				$(".content-box-tabs li:eq(1) a").click();
				break;
			case "other":
				$(".content-box-tabs li:eq(2) a").click();
				break;
		}
	});
</script>